#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<set>
using namespace std;

class Solution {
public:
    int findRepeatNumber(vector<int>& nums) {
        set<int> S;
        for(int i = 0;i<nums.size();++i){
            if(S.insert(nums[i]).second==false){
                return nums[i];
            }
        }
        return 0;
    }
};

